@extends('layout.admin')

@section('title','商家后台首页')

@section('css')
	<link href="/assets/css/css.css" type="text/css" rel="stylesheet" />
	<link href="/assets/css/main.css" type="text/css" rel="stylesheet" />
	<link href="/assets/css/other.css" type="text/css" rel="stylesheet" />
@endsection

@section('content')

<!--main_top-->
	<table width="99%" border="0" cellspacing="0" cellpadding="0" id="main">
	<div style="padding:30px 0px 0px 20px;">
		<tr >
			<td colspan="2" align="left" valign="top">
				<span  style="margin-left:15px;" class="time"><strong>您好！{{session('shopername')}}</strong><u>[超级大boss]</u></span>
				<div class="top">
					<span class="left">您的登灵时间：<?= date('Y-m-d H:i',time()) ?>&nbsp;&nbsp
					;&nbsp;&nbsp;如非您本人操作，请及时</span>
					<a href="/adminShoper/modify" target="mainFrame" onFocus="this.blur()">更改密码</a>
				</div>
				<div class="sec">这是您第<span class="num"><?= rand(1,80) ?></span>次,登录！</div>
			</td>
		</tr>
		<tr>
			<td align="left" valign="top" width="50%">
				<div class="main-tit">
					<div id="a"></div>
					<div style="float:left;margin-right:10px;font-size:20px">店铺信息</div>&nbsp;&nbsp;&nbsp;
					<a href="/adminShop/update" class="am-btn am-btn-primary tpl-btn-bg-color-success ">修改店铺信息</a>
				</div>

				<div class="main-con">
					店铺id：{{$data->id}}<br/>
					店铺名称：{{$data->shopname}}<br/>
					店铺公告：{{$data->content}}<br/>
					店铺地址：{{$data->address}}<br/>
					店铺状态：{{$data->shopstatus}}<br/>

				    <span style="float:left">店铺状态：</span>
			        <div class="tpl-switch" style="float:left">
			            <input type="checkbox" id="abc" class="ios-switch bigswitch tpl-switch-btn" @if($data->shopstatus == '0') checked="checked" @endif/>
			            <div class="tpl-switch-btn-view">
			                <div>
			                </div>
			            </div>
			        </div>

				</div>
			</td>
			<td align="left" valign="top" width="49%">
				<div class="main-tit"></div>
				<div class="main-con">
					店铺分类：{{$data->sptype}}&nbsp;&nbsp;<br/>

					总销售量：{{$count}}<br/>

					收入：{{$data->income}}<br/>
					店铺logo：<img src="{{$data->logo}}" alt="暂无图片" style="width:100px"><br/>
				</div>
			</td>
		</tr>

		</div>
	</table>
@endsection

@section('JQ')

<script type="text/javascript">
// $(function(){
// 	$(alert('dddddd'))
// 	console.log($('#abc'));
// });
var id = document.getElementById('abc');
// tag=true;
id.onclick = function(){
	msg = id.checked;
	$.get('/adminShop/status/start',{status:msg},function(data){
			if(data['status'] == '0') {
				remind(data['msg']);
			}else{
				remind('更新失败');
			}
		},'json');

	function remind($str) {
		$('#a').html($str);
	};
	
}
</script>
@endsection
